
#1/ for in的正
print('第1种')
for row in range(1,10):
    for col in range(1,row+1):
        print('{}*{}={:<4}'.format(row,col,row*col),end=' ')
    print('')

print('='*60)
#2/ for in的反
print('第2种')
for row in range(9,0,-1):
    for col in range(1,row+1):
        print('{}*{}={:<4}'.format(row,col,row*col),end=' ')
    print('')
print('='*60)
#
# #3/ for in的正--1*1右上角
print('第3种')
for col in range(1,10):
    for row in range(9,0,-1):
        if row>col:
            print(" "*9,end='')
        else:
            print('{}*{}={:<4}'.format(row,col,row*col),end=' ')
    print('')

print('='*60)
#
# #4/ for in的正--
#
print('第4种')
for col in range(9,0,-1):
    for row in range(9,0,-1):
        if row>col:
            print(" "*9,end='')
        else:
            print('{}*{}={:<4}'.format(row,col,row*col),end=' ')
    print('')

print('='*60)
#
#
#
# #5/ while的正
print('第5种')
r = 1
while r<10:
    c=1
    while c < r + 1:
        print('{}*{}={:<4}'.format(r, c, r * c), end=' ')
        c +=1
    print(" ")
    r += 1

print("=" * 70)
#
# #6/ while的正
print('第6种')
r = 9
while r>0:
    c=1
    while c < r + 1:
        print('{}*{}={:<4}'.format(r, c, r * c), end=' ')
        c +=1
    print(" ")
    r -= 1

print("=" * 70)

#7/ while的正  1*1在右上
print('第7种')
c = 1
while c<10:
    l=1
    while l < 10-c :
        print(" " * 9, end='')
        l +=1
    r = c
    while r>0:
        print('{}*{}={:<4}'.format(r, c, r * c), end=' ')
        r -= 1
    print(" ")
    c += 1

print("=" * 70)

#8/ while 1*1在右下
print('第8种')
c = 9
while c>0:
    l=9
    while l > c :
        print(" " * 9, end='')
        l -=1
    r = c
    while r>0:
        print('{}*{}={:<4}'.format(r, c, r * c), end=' ')
        r -= 1
    print(" ")
    c -= 1

print("=" * 70)


